package com.f5.management.utils;

import com.f5.management.dao.ParkingManagementDAO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

public class Util {
    @Autowired
    ParkingManagementDAO managementDAO;

    /**
     *
     * @param startTime 租借时间
     * @param endTime 结束时间
     * @return 价格
     */
    public static int dateToMoney(Date startTime, Date endTime) {
        long from1 = endTime.getTime();
        long to1 = startTime.getTime();
        int time = (int) ((from1 - to1) / (1000 * 60 * 60 * 24));

        int money = 0;
        if(time < 30) {
            money = time * 10;
        } else {
            money = time * 7;
        }

        return money;
    }
}
